import React, { Component } from 'react';
import './Navbar.css'
import {withRouter} from 'react-router-dom';


class Navbar extends Component{
    constructor(){
        super();
    }
    toLogin(){
        this.props.history.push({pathname:"/Login"});
    }
    render(){
        if (this.props.NavbarShow===true){
            return(
                <ul className="Navbar">
                    <li>
                        <i className="fa fa-home"></i>
                        <span>首页</span>
                    </li>
                    <li>
                        <i className="fa  fa-shopping-cart"></i>
                        <span>购物车</span>
                    </li>
                    <li onClick={this.toLogin.bind(this)}>
                        <i className="fa fa-user" ></i>
                        <span>个人中心</span>
                    </li>
                    <li>
                        <i className="fa  fa-search"></i>
                        <span>搜索</span>
                    </li>
                    <li>
                        <i className="fa fa-repeat"></i>
                        <span>刷新</span>
                    </li>
                    <li>
                        <i className="fa fa-sign-in"></i>
                        <span>登录</span>
                    </li>
                </ul>
            )
        }else {
            return null;
        }
    }
}


export default withRouter(Navbar);